<template>
    <section class="NewIndexScore">
        <PendingTask ref="PendingTask" isReview = "-1" @getCurrentTask="getCurrentTask" @getTaskIndex="getTaskIndex">
            <template slot-scope="props">
                <div :index="props.index" ref="task" v-if="props.index === taskIndex && isShowTaskDetail" class="scoreDiv">
                    <div style="height: 100%" v-if="currentObject.id">
                        <el-row style="height: 100%">
                          <el-col :span="10" class="tree_box">
                            <el-col class="tree_box_quota" style="padding: 30px 0 0 30px" :span="12">
                              <el-tree
                                v-if="isShowTree"
                                :props="treeProps"
                                :load="loadNode"
                                lazy
                                highlight-current
                                accordion
                                @node-click="handleNodeClick"
                                @check-change="handleCheckChange">
                                <span class="custom-tree-node" slot-scope="{ node }">
                                  <span>{{ node.label }}</span>
                                  <span>
                                    <i style="color: #e63c3c;margin-left: 30px" :class="`${node.data.hasScore ? '' : 'el-icon-warning'}`"></i>
                                  </span>
                                </span>
                              </el-tree>
                            </el-col>
                            <el-col class="tree_box_town" style="padding: 25px 0 0 0px" :span="11">
                              <!-- <el-tree :data="townList" :props="defaultProps" @node-click="handleNodeTownClick"></el-tree> -->
                              <el-tree
                                v-if="isShowTownTree"
                                accordion
                                highlight-current
                                :props="townTreeProps"
                                :load="loadTownNode"
                                @node-click="handleNodeTownClick"
                                lazy>
                                <span class="custom-tree-node" slot-scope="{ node }">
                                  <span>{{ node.label }}</span>
                                  <span>
                                    <i style="color: #e63c3c;margin-left: 30px" :class="`${node.data.flag ? '' : 'el-icon-warning'}`"></i>
                                  </span>
                                </span>
                              </el-tree>
                            </el-col>
                          </el-col>
                          <el-col style="padding: 20px" :span="14" v-loading="scoreLoad">
                            <div v-for="item in scoreList" :key="item.index">
                              <div style="text-align: left; font-size: 18px; font-weight: bold">
                                  <el-col :span="3">二级指标：</el-col>
                                  <el-col :span="21">{{item.quotaName}}<span style="color: red">&nbsp;&nbsp;({{item.quotaScore}}分)</span></el-col>
                              </div>

                              <div class="otherInfo" style="text-align: left;">
                                <!-- <el-col :span="3">打分：</el-col> -->
                                <el-col :span="24" style="text-align: left;">
                                    <!--政治站位-->
                                    <div v-if="tabLabel=='政治站位'" class="loadDiv" v-loading="scoreLoad">
                                        <div v-for="item in scoreList" class="allCunScore" >
                                            <div style="margin-bottom: 20px;">{{item.districtName}}</div>
                                            <div>
                                                <div class="indexLabel">{{form.quotaName}}等次</div>
                                                <div class="indexValue">
                                                    <!-- <el-input type="number" v-model="item.villageLevelAchievements" :disabled="true"></el-input> -->
                                                    <el-select clear="typeInput" v-model="item.field1" placeholder="请选择" :disabled="diaDisabled">
                                                      <el-option label="优秀" value="优秀"></el-option>
                                                      <el-option label="良好" value="良好"></el-option>
                                                      <el-option label="一般" value="一般"></el-option>
                                                      <el-option label="差" value="差"></el-option>
                                                    </el-select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--日常表现-->
                                    <div v-else-if="tabLabel=='日常表现'" class="loadDiv" v-loading="scoreLoad">
                                        <div v-for="item in scoreList" class="allCunScore" >
                                            <div style="margin-bottom: 20px;">{{item.districtName}}</div>
                                            <!-- <div>
                                                <div class="indexLabel">{{form.quotaName}}得分</div>
                                                <div class="indexValue">
                                                    <el-input type="number" v-model="item.routineScore" :disabled="diaDisabled"></el-input>
                                                </div>
                                            </div> -->
                                            <div>
                                                <div class="indexLabel">{{form.quotaName}}等次</div>
                                                <div class="indexValue">
                                                    <!-- <el-input type="number" v-model="item.villageLevelAchievements" :disabled="true"></el-input> -->
                                                    <el-select clear="typeInput" v-model="item.field2" @change="getRoutineSum(item)" placeholder="请选择" :disabled="diaDisabled">
                                                      <el-option label="A" value="A"></el-option>
                                                      <el-option label="B" value="B"></el-option>
                                                      <el-option label="C" value="C"></el-option>
                                                    </el-select>
                                                </div>
                                            </div>
                                            <div>
                                                <div class="indexLabel">{{form.quotaName}}换算得分</div>
                                                <div class="indexValue">
                                                    <el-input type="number" v-model="item.score" :disabled="true"></el-input>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--村级实绩-->
                                    <div v-else-if="tabLabel=='村级实绩'" class="loadDiv" v-loading="scoreLoad">
                                        <div v-for="item in scoreList" class="allCunScore" >
                                            <div style="margin-bottom: 20px;">{{item.districtName}}</div>
                                            <div>
                                                <div class="indexLabel">{{form.quotaName}}得分</div>
                                                <div class="indexValue">
                                                    <el-input type="number" v-model="item.villageLevelAchievementsScore" :disabled="diaDisabled"></el-input>
                                                </div>
                                            </div>
                                            <div>
                                                <div class="indexLabel">{{form.quotaName}}等次</div>
                                                <div class="indexValue">
                                                    <!-- <el-input type="number" v-model="item.villageLevelAchievements" :disabled="true"></el-input> -->
                                                    <el-select clear="typeInput" v-model="item.villageLevelAchievements" @change="getSum(item)" placeholder="请选择" :disabled="diaDisabled">
                                                      <el-option label="A" value="A"></el-option>
                                                      <el-option label="B" value="B"></el-option>
                                                      <el-option label="C" value="C"></el-option>
                                                      <el-option label="D" value="D"></el-option>
                                                    </el-select>
                                                </div>
                                            </div>
                                            <div>
                                                <div class="indexLabel">{{form.quotaName}}换算得分</div>
                                                <div class="indexValue">
                                                    <el-input type="number" v-model="item.score" :disabled="true"></el-input>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--监测指标-->
                                    <div v-else-if="tabLabel=='监测指标'" class="loadDiv" v-loading="scoreLoad">
                                        <div v-for="item in scoreList" class="allCunScore" >
                                            <div style="font-size: 18px; font-weight: bold;margin-bottom: 20px">{{item.districtName}}</div>
                                            <!--村集体经济收入-->
                                            <div v-if="form.quotaId&&form.quotaId.indexOf('0301')!=-1">
                                                <div>
                                                    <div class="indexLabel">本年度村集体经济五项收入(万元)</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field5" :disabled="diaDisabled" @input="geteConomicSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">2020村集体经济五项收入(万元)</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field6" :disabled="true" @input="geteConomicSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">2019村集体经济五项收入(万元)</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field7" :disabled="true" @input="geteConomicSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <el-tooltip popper-class="tooltip_formula" effect="light" content="年度村集体经济五项收入较上年度和上上年度平均值相比，持平得3分，增长10万元以内得4分，增长10~20万元得4.5分，增长20~30万元得5分，增长30~40万元得5.4分，增长40~50万元得5.8分，增长50万元及以上得6分；减少10万元以内得2分，减少10~20万元以内得1.5分，减少20~30万元以内1分，减少50万元及以上不得分。" placement="top-start">
                                                  <i class="el-icon-info icon_formula"> 分数计算公式</i>
                                                </el-tooltip>
                                                <!-- <div>
                                                    <div class="indexLabel">年度村集体经济收入佐证</div>
                                                    <div class="indexValue">
                                                        <FileUpload :value="item.incomeSupportDoc" @getValue="item.incomeSupportDoc = $event" style="width: 150px;" :disabled="diaDisabled"></FileUpload>
                                                    </div>
                                                </div> -->
                                            </div>
                                            <!--农村人居环境-->
                                            <!-- <div v-if="form.quotaId&&form.quotaId.indexOf('0305')!=-1">
                                                <div>
                                                    <div class="indexLabel">人居环境是否通过检查</div>
                                                    <div class="indexValue">
                                                        <el-input v-model="item.hasPass" :disabled="diaDisabled"></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">人居佐证</div>
                                                    <div class="indexValue">
                                                        <FileUpload :value="item.environmentSupportDoc" @getValue="item.environmentSupportDoc = $event" style="width: 150px;" :disabled="diaDisabled"></FileUpload>
                                                    </div>
                                                </div>
                                            </div> -->
                                            <!--农村基层党建标准化建设-->
                                            <div v-if="form.quotaId&&form.quotaId.indexOf('0302')!=-1">
                                                <div>
                                                    <div class="indexLabel">组织生活任务完成率得分</div>
                                                    <div class="indexValue">
                                                        <el-input v-model="item.partyActivityFinishRatio" :disabled="true"></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">村干部员额数量得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.cadrePosts" :disabled="true" @input="getScoreSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">为民服务标准化得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field31" :disabled="diaDisabled" @input="getScoreSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">村级挂牌清理工作得分</div>
                                                    <div class="indexValue">
                                                        <el-input v-model="item.field32" :disabled="diaDisabled" @input="getScoreSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">网格巡查走访得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field33" :disabled="diaDisabled" @input="getScoreSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <!-- <div>
                                                    <div class="indexLabel">挂牌清理完成率</div>
                                                    <div class="indexValue">
                                                        <el-input v-model="item.cleanFinishRatio" :disabled="diaDisabled"></el-input>
                                                    </div>
                                                </div> -->  
                                                <!-- <div>
                                                    <div class="indexLabel">是否有村干部35周岁以下得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.cadreBelowThirtyFive" :disabled="true"></el-input>
                                                    </div>
                                                </div> -->
                                                <div>
                                                    <div class="indexLabel">乡风文明测评得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field34" :disabled="diaDisabled" @input="getScoreSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <!-- <div>
                                                    <div class="indexLabel">是否有女性村干部得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.cadreBetweenThirtyFiveToFifty" :disabled="true"></el-input>
                                                    </div>
                                                </div> -->
                                                <!-- <div>
                                                    <div class="indexLabel">农村标准化建设情况得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.cleanFinishRatio" :disabled="diaDisabled" @input="getScoreSum(item)"></el-input>
                                                    </div>
                                                </div> -->
                                                <!-- <div>
                                                    <div class="indexLabel">村干部超过50周岁</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.cadreOverFifty" :disabled="diaDisabled"></el-input>
                                                    </div>
                                                </div> -->
                                            </div>
                                            <!--为民实事工程-->
                                            <div v-if="form.quotaId&&form.quotaId.indexOf('0304')!=-1">
                                                <div>
                                                    <div class="indexLabel">为民实事工程总额</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field3" :disabled="diaDisabled" @input="getPracticalSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">年度村集体经济五项收入</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field5" :disabled="true" @input="getPracticalSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <el-tooltip popper-class="tooltip_formula" effect="light" content="为民实事项目总额 / 年度村集体经济五项收入 ，高于50%的满分，50%以下按比例得分" placement="top-start">
                                                  <i class="el-icon-info icon_formula"> 分数计算公式</i>
                                                </el-tooltip>
                                                <!-- <div>
                                                    <div class="indexLabel">总额佐证材料</div>
                                                    <div class="indexValue">
                                                        <FileUpload :value="item.projectAmountSupportDoc" @getValue="item.projectAmountSupportDoc = $event" style="width: 150px;" :disabled="diaDisabled"></FileUpload>
                                                    </div>
                                                </div> -->
                                            </div>
                                            <!--信访-->
                                            <div v-if="form.quotaId&&form.quotaId.indexOf('0303')!=-1">
                                                <!-- <div>
                                                    <div class="indexLabel">常驻人口</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.population" :disabled="diaDisabled"></el-input>
                                                    </div>
                                                </div> -->
                                                <div>
                                                    <div class="indexLabel">村年度信访总量</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field27" @input="getPetitionItemScoreSum(item)" :disabled="diaDisabled" ></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">村级常住人口</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field28" @input="getPetitionItemScoreSum(item)" :disabled="diaDisabled" ></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">赴镇江市及以上信访数量</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field29" @input="getPetitionItemScoreSum(item)" :disabled="diaDisabled" ></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">村年度信访化解数量</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field30" @input="getPetitionItemScoreSum(item)" :disabled="diaDisabled" ></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">信访投诉率得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.petitionLetterAmount" @input="getPetitionScoreSum(item)" :disabled="true" ></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">越级上访率得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.skipPetitionLetterAmount" @input="getPetitionScoreSum(item)" :disabled="true"></el-input>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="indexLabel">信访化解率得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.defusePetitionLetterAmount" @input="getPetitionScoreSum(item)" :disabled="true"></el-input>
                                                    </div>
                                                </div>
                                                <el-tooltip popper-class="tooltip_formula" effect="light" content="信访投诉率2分，根据“阳光信访”平台中村年度信访总量 / 村级常住人口 * 1000计算结果，进行区间赋分；越级上访率2分，根据赴镇江市及以上信访数量 / 村年度信访总量计算结果，进行区间赋分；信访化解率1分，根据村年度信访化解数量 / 村年度信访总量计算结果，进行区间赋分" placement="top-start">
                                                  <i class="el-icon-info icon_formula"> 分数计算公式</i>
                                                </el-tooltip>
                                                <!-- <div>
                                                    <div class="indexLabel">信访佐证材料</div>
                                                    <div class="indexValue">
                                                        <FileUpload :value="item.petitionLetterSupportDoc" @getValue="item.petitionLetterSupportDoc = $event" style="width: 150px;" :disabled="diaDisabled"></FileUpload>
                                                    </div>
                                                </div> -->
                                            </div>
                                            <!-- 乡村振兴重点任务 -->
                                            <div v-if="form.quotaId&&form.quotaId.indexOf('0305')!=-1">
                                                <div>
                                                    <div class="indexLabel">乡村振兴战略满意度调查得分</div>
                                                    <div class="indexValue">
                                                        <el-input v-model="item.field8" type="number" :disabled="diaDisabled" @input="getVillageSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <div style="margin: 10px 0 10px 0">
                                                    <div class="indexLabel">农村人居环境整治常态化管理得分</div>
                                                    <div class="indexValue">
                                                        <el-input v-model="item.field9" type="number" :disabled="diaDisabled" @input="getVillageSum(item)"></el-input>
                                                    </div>
                                                    <!-- <div class="indexValue">
                                                        <el-button @click="addQuestion(item)">添加问题</el-button>
                                                    </div> -->
                                                </div>
                                                <!-- <div v-if="Array.isArray(item.field9)" v-for="(quesItem, quesIndex) in item.field9" :key="quesIndex">
                                                    <div class="indexLabel" style="width: 80px">问题{{quesIndex + 1}}</div>
                                                    <div class="indexValue wenti" style="width: 255px">
                                                        <el-input v-model="quesItem.quesContent" :disabled="diaDisabled"></el-input>
                                                    </div>
                                                    <i class="el-icon-delete delete_icon" @click="deleteQuestion(item.field9, quesIndex, item)"></i>
                                                </div> -->
                                                <!-- <div>
                                                    <div class="indexLabel">乡村振兴重点任务得分</div>
                                                    <div class="indexValue">
                                                        <el-input v-model="item.hasPass" :disabled="diaDisabled"></el-input>
                                                    </div>
                                                </div> -->
                                                <el-tooltip popper-class="tooltip_formula" effect="light" content="乡村振兴战略满意度调查3 分，由市农业农村局联合第三方单位进行调查，根据评价结果得分。农村人居环境整治常态化管理 2 分，运用“负向积分法”，在督查、检查、巡察等工作中，被镇江市级及以上通报批评的或在省级监管平台被发现问题的，每一例扣 0.5 分，扣完为止。" placement="top-start">
                                                  <i class="el-icon-info icon_formula"> 分数计算公式</i>
                                                </el-tooltip>
                                            </div>
                                            <!-- 自然资源违法防控 -->
                                            <div v-if="form.quotaId&&form.quotaId.indexOf('0306')!=-1">
                                                <!-- <div>
                                                    <div class="indexLabel">乡村振兴战略满意度调查得分</div>
                                                    <div class="indexValue">
                                                        <el-input v-model="item.manyidu" :disabled="diaDisabled"></el-input>
                                                    </div>
                                                </div> -->
                                                <div style="margin: 10px 0 10px 0">
                                                    <div class="indexLabel">违法行为处置得分</div>
                                                    <div class="indexValue">
                                                        <el-input v-model="item.field25" type="number" :disabled="diaDisabled" @input="getNaturalResourcesSum(item)"></el-input>
                                                    </div>
                                                    <!-- <div class="indexValue">
                                                        <el-button @click="addQuestion1(item)">添加问题</el-button>
                                                    </div> -->
                                                </div>
                                                <!-- <div v-if="Array.isArray(item.field25)" v-for="(quesItem, quesIndex) in item.field25">
                                                    <div class="indexLabel" style="width: 80px">违法行为{{quesIndex + 1}}</div>
                                                    <div class="indexValue wenti" style="width: 255px">
                                                        <el-input v-model="quesItem.quesContent" :disabled="diaDisabled"></el-input>
                                                    </div>
                                                    <i class="el-icon-delete delete_icon" @click="deleteQuestion1(item.field25, quesIndex, item)"></i>
                                                </div> -->
                                                <el-tooltip popper-class="tooltip_formula" effect="light" content="违法行为处置1分，采用“负向积分法”，对新增土地、矿产等违法行为未能及时发现、制止并未上报的，每一起扣0.5分，扣完为止" placement="top-start">
                                                  <i class="el-icon-info icon_formula"> 分数计算公式</i>
                                                </el-tooltip>
                                                <div style="margin: 10px 0 10px 0">
                                                    <div class="indexLabel">新增土地违法防控得分</div>
                                                    <div class="indexValue">
                                                        <el-input v-model="item.field26" type="number" :disabled="diaDisabled" @input="getNaturalResourcesSum(item)"></el-input>
                                                    </div>
                                                    <!-- <div class="indexValue">
                                                        <el-button @click="addQuestion2(item)">添加问题</el-button>
                                                    </div> -->
                                                </div>
                                                <!-- <div v-if="Array.isArray(item.field26)" v-for="(quesItem, quesIndex) in item.field26">
                                                    <div class="indexLabel" style="width: 80px">违法行为{{quesIndex + 1}}</div>
                                                    <div class="indexValue wenti" style="width: 255px">
                                                        <el-input v-model="quesItem.quesContent" :disabled="diaDisabled"></el-input>
                                                    </div>
                                                    <i class="el-icon-delete delete_icon" @click="deleteQuestion1(item.field26, quesIndex, item)"></i>
                                                </div> -->
                                                <el-tooltip popper-class="tooltip_formula" effect="light" content="新增土地违法防控2分，发生新增占用耕地（擅自建房、挖砂、取土、挖田造湖造景等）、新增占用永久基本农田（发展林果业、挖塘养鱼等）及未取得合法用地规划手续在建设用地、未利用地上建设等情形的，每一起扣一分，扣完为止。" placement="top-start">
                                                  <i class="el-icon-info icon_formula"> 分数计算公式</i>
                                                </el-tooltip>
                                                <!-- <div>
                                                    <div class="indexLabel">乡村振兴重点任务得分</div>
                                                    <div class="indexValue">
                                                        <el-input v-model="item.hasPass" :disabled="diaDisabled"></el-input>
                                                    </div>
                                                </div> -->
                                            </div>
                                            <div style="margin-top: 20px">
                                                <div class="indexLabel">{{form.quotaName}}得分</div>
                                                <div class="indexValue">
                                                    <!-- <el-input type="number" v-model="item.score" :disabled="diaDisabled" @input="getProsperScoreSum(item)"></el-input> -->
                                                    <el-input type="number" v-model="item.score" :disabled="diaDisabled || specialDisabled"></el-input>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--综合评议-->
                                    <div v-else-if="tabLabel=='综合评议'" class="loadDiv synthesis" v-loading="scoreLoad">
                                        <div v-for="item in scoreList" class="allCunScore">
                                            <div style="font-size: 18px; font-weight: bold;margin-bottom: 20px">{{item.districtName}}</div>
                                            <!-- <div class="tableContent" >
                                                <h4 style="text-align: center;" class="tableBorder">镇机关人员综合评议表</h4>
                                                <div style="display: flex">
                                                    <div style="flex:3" class="tableBorder">综合评议</div>
                                                    <div style="flex:4">
                                                        <div style="display: flex">
                                                            <div class="tableResult">优秀</div>
                                                            <div class="tableResult">称职</div>
                                                            <div class="tableResult">基本称职</div>
                                                            <div class="tableResult">不称职</div>
                                                        </div>
                                                        <div style="display: flex">
                                                            <div class="tableResult">
                                                                <el-input v-model="item.field10" :disabled="diaDisabled" @input="getGovSum(item)"></el-input>
                                                            </div>
                                                            <div class="tableResult">
                                                                <el-input v-model="item.field11" :disabled="diaDisabled" @input="getGovSum(item)"></el-input>
                                                            </div>
                                                            <div class="tableResult">
                                                                <el-input v-model="item.field12" :disabled="diaDisabled" @input="getGovSum(item)"></el-input>
                                                            </div>
                                                            <div class="tableResult">
                                                                <el-input v-model="item.field13" :disabled="diaDisabled" @input="getGovSum(item)"></el-input>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                              </div>
                                              <el-tooltip popper-class="tooltip_formula" effect="light" content="评议得分=（优秀票数 * 100 + 称职票数 * 80 + 基本称职票数 * 50）/ 有效票数 / 100 * 对应分值" placement="top-start">
                                                  <i class="el-icon-info icon_formula"> 分数计算公式</i>
                                                </el-tooltip> -->
                                              <div style="margin-top: 10px">
                                                  <div class="indexLabel">镇机关人员综合评议得分（3分）</div>
                                                  <div class="indexValue">
                                                      <el-input type="number" v-model="item.field14" @input="getSynthesisScore(item)" :disabled="diaDisabled"></el-input>
                                                  </div>
                                              </div>
                                            <div class="tableContent" style="margin-top: 30px" >
                                                <h4 style="text-align: center;" class="tableBorder">村“两委”干部测评表</h4>
                                                <div style="display: flex">
                                                    <div style="flex:3" class="tableBorder">综合评议</div>
                                                    <div style="flex:4">
                                                        <div style="display: flex">
                                                            <div class="tableResult">优秀</div>
                                                            <div class="tableResult">称职</div>
                                                            <div class="tableResult">基本称职</div>
                                                            <div class="tableResult">不称职</div>
                                                        </div>
                                                        <div style="display: flex">
                                                            <div class="tableResult">
                                                                <el-input v-model="item.field15" :disabled="diaDisabled" @input="getCadreSum(item)"></el-input>
                                                            </div>
                                                            <div class="tableResult">
                                                                <el-input v-model="item.field16" :disabled="diaDisabled" @input="getCadreSum(item)"></el-input>
                                                            </div>
                                                            <div class="tableResult">
                                                                <el-input v-model="item.field17" :disabled="diaDisabled" @input="getCadreSum(item)"></el-input>
                                                            </div>
                                                            <div class="tableResult">
                                                                <el-input v-model="item.field18" :disabled="diaDisabled" @input="getCadreSum(item)"></el-input>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                              </div>
                                              <el-tooltip popper-class="tooltip_formula" effect="light" content="评议得分=（优秀票数 * 100 + 称职票数 * 80 + 基本称职票数 * 50）/ 有效票数 / 100 * 对应分值" placement="top-start">
                                                  <i class="el-icon-info icon_formula"> 分数计算公式</i>
                                                </el-tooltip>
                                              <div style="margin-top: 10px">
                                                  <div class="indexLabel">村“两委”干部测评得分（2分）</div>
                                                  <div class="indexValue">
                                                      <el-input type="number" v-model="item.field19"  @input="getSynthesisScore(item)" :disabled="true"></el-input>
                                                  </div>
                                              </div>
                                            <div class="tableContent" style="margin-top: 30px"  >
                                                <h4 style="text-align: center;" class="tableBorder">党员群众满意度调查表</h4>
                                                <div style="display: flex">
                                                    <div style="flex:3" class="tableBorder">总体评价</div>
                                                    <div style="flex:4">
                                                        <div style="display: flex">
                                                            <div class="tableResult">满意</div>
                                                            <div class="tableResult">比较满意</div>
                                                            <div class="tableResult">基本满意</div>
                                                            <div class="tableResult">不满意</div>
                                                        </div>
                                                        <div style="display: flex">
                                                            <div class="tableResult">
                                                                <el-input v-model="item.field20" :disabled="diaDisabled" @input="getGratificationSum(item)"></el-input>
                                                            </div>
                                                            <div class="tableResult">
                                                                <el-input v-model="item.field21" :disabled="diaDisabled" @input="getGratificationSum(item)"></el-input>
                                                            </div>
                                                            <div class="tableResult">
                                                                <el-input v-model="item.field22" :disabled="diaDisabled" @input="getGratificationSum(item)"></el-input>
                                                            </div>
                                                            <div class="tableResult">
                                                                <el-input v-model="item.field23" :disabled="diaDisabled" @input="getGratificationSum(item)"></el-input>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                              </div>
                                              <el-tooltip popper-class="tooltip_formula" effect="light" content="评议得分=（满意票数 * 100 + 比较满意票数 * 80 + 基本满意票数 * 50）/ 有效票数 / 100 * 对应分值" placement="top-start">
                                                  <i class="el-icon-info icon_formula"> 分数计算公式</i>
                                                </el-tooltip>
                                               <div style="margin-top: 10px">
                                                  <div class="indexLabel">党员群众满意度调查得分（5分）</div>
                                                  <div class="indexValue">
                                                      <el-input type="number" v-model="item.field24" @input="getSynthesisScore(item)" :disabled="true"></el-input>
                                                  </div>
                                              </div>
                                            <div>
                                                <div style="margin-top: 20px">
                                                    <div class="indexLabel">{{form.quotaName}}得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.score" :disabled="true"></el-input>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--素能评价-->
                                    <div v-else-if="tabLabel=='素能评价'" class="loadDiv" v-loading="scoreLoad">
                                        <div v-for="item in scoreList" class="allCunScore" >
                                            <div style="font-size: 18px; font-weight: bold;margin-bottom: 20px">{{item.districtName}}</div>
                                            <div class="tableContent"  v-if="item.kpiEvaluations.length>0&&form.quotaId&&form.quotaId.indexOf('0402')!==-1">
                                                <h4 style="text-align: center;"  class="tableBorder">{{tableName}}</h4>
                                                <div style="display: flex">
                                                    <!-- <div class="tableResult">序号</div> -->
                                                    <!-- <div style="flex: 2" class="tableBorder">项目</div> -->
                                                    <!--表头不一样 0403党员群众-->
                                                    <div style="flex: 1;" v-if="form.quotaId&&form.quotaId.indexOf('0402')!==-1">
                                                        <div class="tableBorder">胜任力</div>
                                                        <div style="display: flex">
                                                            <div class="tableResult">优秀</div>
                                                            <div class="tableResult">良好</div>
                                                            <div class="tableResult">一般</div>
                                                            <div class="tableResult">差</div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div v-for="(sub,subIndex) in item.kpiEvaluations" style="display: flex" v-if="form.quotaId&&form.quotaId.indexOf('0402')!==-1">
                                                    <!-- <div class="tableResult">{{sub.indexNum}}</div> -->
                                                    <!-- <div style="flex: 2" class="tableBorder">{{sub.commentProject}}</div> -->
                                                    <div class="tableResult">
                                                        <el-input v-model="sub.good" :disabled="diaDisabled" @input="getAdministrativeAbilitySum(item)"></el-input>
                                                    </div>
                                                    <div class="tableResult">
                                                        <el-input v-model="sub.preferably" :disabled="diaDisabled" @input="getAdministrativeAbilitySum(item)"></el-input>
                                                    </div>
                                                    <div class="tableResult">
                                                        <el-input v-model="sub.commonly" :disabled="diaDisabled" @input="getAdministrativeAbilitySum(item)"></el-input>
                                                    </div>
                                                    <div class="tableResult">
                                                        <el-input v-model="sub.bad" :disabled="diaDisabled" @input="getAdministrativeAbilitySum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <el-tooltip popper-class="tooltip_formula" effect="light" content="评议得分=（优秀票数 * 100 + 良好票数 * 80 + 一般票数 * 50）/ 有效票数 / 100 * 对应分值" placement="top-start">
                                                  <i class="el-icon-info icon_formula"> 分数计算公式</i>
                                                </el-tooltip>
                                            </div>
                                            <!-- <div v-if="form.parentQuotaId&&form.parentQuotaId.indexOf('0402')!=-1">
                                                <div>
                                                    <div class="indexLabel">附件佐证材料</div>
                                                    <div class="indexValue">
                                                        <FileUpload :value="item.judgeSupportDoc" @getValue="item.judgeSupportDoc = $event" style="width: 150px;" :disabled="diaDisabled"></FileUpload>
                                                    </div>
                                                </div>
                                            </div> -->
                                            <!--基础知识测试-->
                                            <div v-if="form.quotaId&&form.quotaId.indexOf('0401')!=-1">
                                                <div>
                                                    <div class="indexLabel">测试得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field35" :disabled="diaDisabled" @input="getBasicKnowledgeSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <el-tooltip popper-class="tooltip_formula" effect="light" content="基础知识测试有市委组织部结合专制村书记集中轮训，依托应知应会题库进行测试，根据成绩按比例得分，总分3分" placement="top-start">
                                                  <i class="el-icon-info icon_formula"> 分数计算公式</i>
                                                </el-tooltip>
                                            </div>
                                            <!--结构化面试测试-->
                                            <div v-if="form.quotaId&&form.quotaId.indexOf('0403')!=-1">
                                                <div>
                                                    <div class="indexLabel">测试得分</div>
                                                    <div class="indexValue">
                                                        <el-input type="number" v-model="item.field36" :disabled="diaDisabled" @input="getStructuringSum(item)"></el-input>
                                                    </div>
                                                </div>
                                                <el-tooltip popper-class="tooltip_formula" effect="light" content="结构化面试测试由市委组织部组织，分板块实施，根据成绩按比例得分，总分3分" placement="top-start">
                                                  <i class="el-icon-info icon_formula"> 分数计算公式</i>
                                                </el-tooltip>
                                            </div>
                                            <div style="margin-top: 20px"> 
                                                <div class="indexLabel">{{form.quotaName}}得分</div>
                                                <div class="indexValue">
                                                    <el-input v-model="item.score" :disabled="true"></el-input>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--加减分项-->
                                    <div v-else-if="tabLabel=='加减分项'" class="loadDiv" v-loading="scoreLoad">
                                        <div v-for="item in scoreList" class="allCunScore" >
                                            <div style="font-size: 18px; font-weight: bold;margin-bottom: 20px">{{item.districtName}}</div>
                                            <div style="margin: 10px 0 10px 0">
                                                <div class="indexLabel" style="width: 300px">村级实绩考核在全镇排名较上年度得分</div>
                                                <div class="indexValue">
                                                    <el-input v-model="item.field37" type="number" :disabled="diaDisabled" @input="getAddScoreSum(item)"></el-input>
                                                </div>
                                            </div>
                                            <div style="margin: 10px 0 10px 0">
                                                <div class="indexLabel" style="width: 300px">获得国家、省、市、县涉农项目支持得分</div>
                                                <div class="indexValue">
                                                    <el-input v-model="item.field38" type="number" :disabled="diaDisabled" @input="getAddScoreSum(item)"></el-input>
                                                </div>
                                            </div>
                                            <div style="margin: 10px 0 10px 0">
                                                <div class="indexLabel" style="width: 300px">重点工作或特色工作得分</div>
                                                <div class="indexValue">
                                                    <el-input v-model="item.field39" type="number" :disabled="diaDisabled" @input="getAddScoreSum(item)"></el-input>
                                                </div>
                                            </div>
                                            <div style="margin: 10px 0 10px 0">
                                                <div class="indexLabel" style="width: 300px">诫勉谈话或警告处分得分</div>
                                                <div class="indexValue">
                                                    <el-input v-model="item.field40" type="number" :disabled="diaDisabled" @input="getAddScoreSum(item)"></el-input>
                                                </div>
                                            </div>
                                            <div style="margin-top: 20px"> 
                                                <div class="indexLabel" style="width: 300px">{{form.quotaName}}得分</div>
                                                <div class="indexValue">
                                                    <el-input v-model="item.score" :disabled="true"></el-input>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--其他指标-->
                                    <div v-else  class="loadDiv" v-loading="scoreLoad" style="font-size: 18px; font-weight: bold;margin-bottom: 20px">
                                        <div v-for="item in scoreList" class="weightInput">
                                            <div>{{item.districtName}}</div>
                                            <el-input type="number" v-model="item.score" :disabled="diaDisabled"></el-input>
                                        </div>
                                    </div>
                                </el-col>
                                <div style="clear: both"></div>
                                <el-row style="text-align: left;margin-left: 12px;padding-top: 20px">
                                    <el-col :span="3">佐证材料：</el-col>
                                    <el-col :span="6">
                                        <!-- <FileUpload :value="item.projectAmountSupportDoc" @getValue="(val)=>{handleFile(val,item.projectAmountSupportDoc)}" :disabled="diaDisabled"></FileUpload> -->
                                        <FileUpload ref="quotaFileUpload" :value="item.attachment.address" @getValue="(val)=>{handleFile(val,item.attachment)}" :disabled="diaDisabled"></FileUpload>
                                    </el-col>
                                </el-row>
                                <div>
                                  <el-button type="success" style="margin: 15px 0 0 10px;padding: 12px 22px;font-size: 20px;" size="medium" :loading="saveBtnLoad" @click="saveScore()" v-if="!diaDisabled && scoreList.length">保存</el-button>
                                </div>
                              </div>
                            </div>
                          </el-col>
                        </el-row>
                    </div>
                </div>
            </template>
        </PendingTask>
    </section>
</template>

<script>
    import PendingTask from "@/components/PendingTask";
    import FileUpload from '@/components/FileUpLoad';
    import MarkeIndex from "./markeIndex";
    export default {
        name: "NewIndexScore",
        data(){
            return{
                indexList:[],
                indexDataList:[],
                diaTitle:'',
                diaVis:false,
                form:{},
                villageList:[],
                user:{},
                submitLoad:false,
                secondIndex:{},
                pageLoad:false,
                activeTab:'',
                cardLoad:false,
                initCun:[],
                currentObject:{},
                scoreList:[],
                tabLabel:'',
                diaTownList:[],
                scoreLoad:false,
                diaTownIndex:'',
                saveBtnLoad:false,
                tableInit:[
                    {
                        indexNum:1,
                        commentProject:'政治作为',
                        commentContent : '严守政治纪律，恪守政治规矩，做到拥护党的决定，对党忠诚;坚决执行上级党委各项决策部署;做到关键时刻顶得上、豁得出;主动加强政治学习和政治历练、积累政治经验。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,

                    },
                    {
                        indexNum:2,
                        commentProject:'发展实绩',
                        CommentContent : '千方百计发展壮大村集体经济;主动带领群众增收致富;大力推进农业产业发展;全心全意为群众办实事;积极改善村庄生产生活环境。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,

                    },
                    {
                        indexNum:3,
                        commentProject:'管理成效',
                        commentContent : '把队伍建设放在突出位置，村两委班子团结、战斗力强、作风优良;管理成效村党员队伍纯洁、风清气正、积极向上;村能人队伍管理有效、帮扶有力。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,

                    },
                    {
                        indexNum:4,
                        commentProject:'治理能力',
                        commentContent : '及时有效处理村级矛盾，做到小事不出村、大事不出镇;严格实行“四理能力议两公开”;积极改善和保障民生;倡导社会主，义精神文明;推进乡村法治建设，提升乡村德治水平。' ,
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,

                    },
                    {
                        indexNum:5,
                        commentProject:'服务群众',
                        commentContent : '密切联系群众，解决实际问题和困难;积极维护群众正当权利和利益;承诺践诺赢得群众信任;关心困难群体，体现党的关怀。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                    },
                    {
                        indexNum:6,
                        commentProject:'综合评议',
                        commentContent : '密切联系群众，解决实际问题和困难;积极维护群众正当权利和利益;承诺践诺赢得群众信任;关心困难群体，体现党的关怀。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                    }
                ],
                tableInitOther:[
                    {
                        indexNum:1,
                        commentProject:'队伍管理能力',
                        commentContent : '严守政治纪律，恪守政治规矩，做到拥护党的决定，对党忠诚;坚决执行上级党委各项决策部署;做到关键时刻顶得上、豁得出;主动加强政治学习和政治历练、积累政治经验。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                        varyBad : 0,

                    },
                    {
                        indexNum:2,
                        commentProject:'群众工作能力',
                        CommentContent : '千方百计发展壮大村集体经济;主动带领群众增收致富;大力推进农业产业发展;全心全意为群众办实事;积极改善村庄生产生活环境。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                        varyBad : 0,
                    },
                    {
                        indexNum:3,
                        commentProject:'引领发展能力',
                        commentContent : '把队伍建设放在突出位置，村两委班子团结、战斗力强、作风优良;管理成效村党员队伍纯洁、风清气正、积极向上;村能人队伍管理有效、帮扶有力。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                        varyBad : 0,
                    },
                    {
                        indexNum:4,
                        commentProject:'为民办实事能力',
                        commentContent : '及时有效处理村级矛盾，做到小事不出村、大事不出镇;严格实行“四理能力议两公开”;积极改善和保障民生;倡导社会主，义精神文明;推进乡村法治建设，提升乡村德治水平。' ,
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                        varyBad : 0,
                    },
                    {
                        indexNum:5,
                        commentProject:'执行工作能力',
                        commentContent : '密切联系群众，解决实际问题和困难;积极维护群众正当权利和利益;承诺践诺赢得群众信任;关心困难群体，体现党的关怀。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                        varyBad : 0,
                    },
                    {
                        indexNum:6,
                        commentProject:'文化素质能力',
                        commentContent : ' ' ,
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                        varyBad : 0,
                    }
                ],
                tableInitCapacity:[
                    {
                        indexNum:1,
                        commentProject:'超过岗位职责要求',
                        commentContent : '严守政治纪律，恪守政治规矩，做到拥护党的决定，对党忠诚;坚决执行上级党委各项决策部署;做到关键时刻顶得上、豁得出;主动加强政治学习和政治历练、积累政治经验。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                    }
                ],
                tableInitOther:[
                    {
                        indexNum:1,
                        commentProject:'队伍管理能力',
                        commentContent : '严守政治纪律，恪守政治规矩，做到拥护党的决定，对党忠诚;坚决执行上级党委各项决策部署;做到关键时刻顶得上、豁得出;主动加强政治学习和政治历练、积累政治经验。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                        varyBad : 0,

                    },
                    {
                        indexNum:2,
                        commentProject:'群众工作能力',
                        CommentContent : '千方百计发展壮大村集体经济;主动带领群众增收致富;大力推进农业产业发展;全心全意为群众办实事;积极改善村庄生产生活环境。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                        varyBad : 0,
                    },
                    {
                        indexNum:3,
                        commentProject:'引领发展能力',
                        commentContent : '把队伍建设放在突出位置，村两委班子团结、战斗力强、作风优良;管理成效村党员队伍纯洁、风清气正、积极向上;村能人队伍管理有效、帮扶有力。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                        varyBad : 0,
                    },
                    {
                        indexNum:4,
                        commentProject:'为民办实事能力',
                        commentContent : '及时有效处理村级矛盾，做到小事不出村、大事不出镇;严格实行“四理能力议两公开”;积极改善和保障民生;倡导社会主，义精神文明;推进乡村法治建设，提升乡村德治水平。' ,
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                        varyBad : 0,
                    },
                    {
                        indexNum:5,
                        commentProject:'执行工作能力',
                        commentContent : '密切联系群众，解决实际问题和困难;积极维护群众正当权利和利益;承诺践诺赢得群众信任;关心困难群体，体现党的关怀。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                        varyBad : 0,
                    },
                    {
                        indexNum:6,
                        commentProject:'文化素质能力',
                        commentContent : ' ' ,
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,
                        varyBad : 0,
                    }
                ],
                tableName:'',
                townList:[],
                townIndex:'',
                currentTown:'',
                submitBtnLoading: false,
                diaDisabled:false,
                currentAttachment: {
                    address: '1111'
                },
                taskIndex: -1,
                isShowTaskDetail : true,
                treeProps: {
                  label: 'quotaName',
                  children: 'zones'
                },
                count: 1,
                isShowTree: false,
                townTreeProps: {
                  children: 'orgChildren',
                  label: 'districtName'
                },
                isShowTownTree: false,
                secondIndexName: '',
                qName: '',
                qform: {},
                secondQuotaId: '',
                secondIndexList: [],
                villageDistrictId: '',
                townTreeData: {},
                specialDisabled: false
            }
        },
        watch: {
          'indexList': {
            handler(){
              if (this.indexList.length) {
                this.isShowTree = true
              } else {
                this.isShowTree = false
              }
            }
          },
          'townList': {
            handler(){
              if (this.townList.length) {
                this.isShowTownTree = true
              } else {
                this.isShowTownTree = false
              }
            }
          }
        },
        methods:{
          handleCheckChange(data, checked, indeterminate) {
          },
          handleNodeTownClick(data){
            if (data.districtId.length == 6) {
              this.townTreeData = data
              this.scoreLoad = true
              this.form = this.qform
              this.tabLabel = this.qName
              this.villageDistrictId = data.districtId
              this.$http('get',`identity/kPITownQuota/scoringBasicByParentDistrictId?townQuotaId=${this.secondQuotaId}&taskId=${this.currentObject.taskId}&districtId=${data.districtId}`,false).then(data => {
                this.scoreList1 = data
                this.scoreList1.forEach(item => {
                  console.log('=============');
                  item.quotaName = this.form.quotaName
                  item.quotaScore = this.form.quotaScore
                  if (!item.cleanFinishRatio) {
                    item.cleanFinishRatio = '1'
                  }
                  if (!item.attachment) {
                    console.log('**********');
                    item.attachment = {address: undefined}
                  }
                  if(this.currentObject.status==0 && this.currentObject.isRejected !== '1'){
                      this.diaDisabled = false;
                  }else if (this.currentObject.status==0 && this.currentObject.isRejected == '1' && item.state == '1') {
                    this.diaDisabled = false;
                  }else{
                      this.diaDisabled = true;
                  }
                })
                if(this.tabLabel=='综合评议'){
                    let type = '';
                    if(this.form.quotaName.indexOf('两委')!=-1){
                        type = 2 ;
                        this.tableName = "村“两委”干部综合评议表";
                    }else if(this.form.quotaName.indexOf('镇机关')!=-1){
                        type = 1 ;
                        this.tableName = "镇机关人员综合评议表";
                    }else if(this.form.quotaName.indexOf('党员群众')!=-1){
                        type = 3 ;
                        this.tableName = "党员群众满意度调查表";
                    }
                    if (type == 2) {
                      this.scoreList1.forEach(item=>{
                          if(item.kpiEvaluations.length==0){
                              item.kpiEvaluations = JSON.parse(JSON.stringify(this.tableInitOther));
                              item.kpiEvaluations.forEach(sub=>{
                                  sub.taskId = this.currentObject.taskId;
                                  sub.districtId = item.districtId;
                                  sub.type = type;
                              })
                          }
                      })
                    } else if (type !== 2&&type !== '') {
                      this.scoreList1.forEach(item=>{
                          if(item.kpiEvaluations.length==0){
                              item.kpiEvaluations = JSON.parse(JSON.stringify(this.tableInit));
                              item.kpiEvaluations.forEach(sub=>{
                                  sub.taskId = this.currentObject.taskId;
                                  sub.districtId = item.districtId;
                                  sub.type = type;
                              })
                          }
                      })
                    }
                    this.scoreList = this.scoreList1
                } else if(this.tabLabel=='素能评价'){
                    let type = '';
                    if(this.form.quotaName.indexOf('行政能力')!=-1){
                        type = 2 ;
                        this.tableName = "行政能力（胜任力）评价表";
                        this.scoreList1.forEach(item=>{
                            if(item.kpiEvaluations.length==0){
                                item.kpiEvaluations = JSON.parse(JSON.stringify(this.tableInitCapacity));
                                item.kpiEvaluations.forEach(sub=>{
                                    sub.taskId = this.currentObject.taskId;
                                    sub.districtId = item.districtId;
                                    sub.type = type;
                                })
                            }
                        })
                    }
                    this.scoreList = this.scoreList1
                } else if(this.tabLabel=='监测指标'){
                  if(this.form.quotaName.indexOf('农村党建重点工作')!=-1){
                    this.$http('get',`identity/centralConsole/statistics/${this.currentObject.taskYear}/${this.villageDistrictId}`,false).then(res => {
                      this.scoreList1.forEach(item => {
                        item.partyActivityFinishRatio = res.activityCompleteRate
                        // item.cadreBetweenThirtyFiveToFifty = res.hasFemale
                        // item.cadreBelowThirtyFive = res.hasUnder35
                        item.cadrePosts = res.overstaffing
                        // item.score = parseFloat(item.partyActivityFinishRatio || 0) + parseFloat(item.cadrePosts || 0) +parseFloat(item.field31 || 0) +parseFloat(item.field32 || 0) +parseFloat(item.field33 || 0) +parseFloat(item.field34 || 0)
                      })
                      this.scoreList = this.scoreList1
                    })
                  } else if (this.form.quotaName.indexOf('年度村集体经济五项收入')!=-1){
                    this.$http('get',`identity/kPIVillageQuota/villageCollectiveEconomy/${this.villageDistrictId}`,false).then(res => {
                      console.log(res,'-=---=-=-=-==-=-=-');
                      this.scoreList1.forEach(item => {
                        item.field6 = res[0]['2020']
                        item.field7 = res[1]['2019']
                        // item.score = parseFloat(item.partyActivityFinishRatio || 0) + parseFloat(item.cadrePosts || 0) +parseFloat(item.field31 || 0) +parseFloat(item.field32 || 0) +parseFloat(item.field33 || 0) +parseFloat(item.field34 || 0)
                      })
                      this.scoreList = this.scoreList1
                    })
                  }
                  // else if (this.form.quotaName.indexOf('信访矛盾调处化解')!=-1){
                  //   this.$http('get',`identity/detectionIndex/getPopulationByYearAndDistrictId?year=${this.currentObject.taskYear - 1}&districtId=${this.villageDistrictId}`,false).then(res => {
                  //     this.scoreList1.forEach(item => {
                  //       item.field28 = res.population
                  //       // item.score = parseFloat(item.partyActivityFinishRatio || 0) + parseFloat(item.cadrePosts || 0) +parseFloat(item.field31 || 0) +parseFloat(item.field32 || 0) +parseFloat(item.field33 || 0) +parseFloat(item.field34 || 0)
                  //     })
                  //     this.scoreList = this.scoreList1
                  //   })
                  // } 
                  // else if (this.form.quotaName.indexOf('乡村振兴重点任务')!=-1) {
                  //   console.log(this.scoreList1,'this.scoreList1');
                  //   this.scoreList1.forEach(item => {
                  //       let str = item.field9 || ''
                  //       let arr = []
                  //       let arr2 = []
                  //       arr = str == '' ? [] : str.split('&')
                  //       console.log(arr,'---------');
                  //       arr.map(item => {
                  //         let obj = {}
                  //         obj.quesContent = item
                  //         console.log(obj,'obj========');
                  //         console.log(item.field9,'item.field9');
                  //         arr2.push(obj)
                  //       })
                  //       item.field9 = arr2
                  //       if(item.score == null) {
                  //         item.score = 2
                  //       }
                  //   })
                  //   this.scoreList = this.scoreList1
                  // } 
                  // else if (this.form.quotaName.indexOf('自然资源违法防控')!=-1) {
                  //   console.log(this.scoreList1,'this.scoreList1');
                  //   this.scoreList1.forEach(item => {
                  //       let str = item.field25 || ''
                  //       let arr = []
                  //       let arr2 = []
                  //       arr = str == '' ? [] : str.split('&')
                  //       console.log(arr,'---------');
                  //       arr.map(item => {
                  //         let obj = {}
                  //         obj.quesContent = item
                  //         console.log(obj,'obj========');
                  //         console.log(item.field25,'item.field25');
                  //         arr2.push(obj)
                  //       })
                  //       item.field25 = arr2

                  //       let strB = item.field26 || ''
                  //       let arrB = []
                  //       let arr2B = []
                  //       arrB = strB == '' ? [] : strB.split('&')
                  //       console.log(arrB,'---------');
                  //       arrB.map(item => {
                  //         let obj = {}
                  //         obj.quesContent = item
                  //         console.log(obj,'obj========');
                  //         console.log(item.field26,'item.field26');
                  //         arr2B.push(obj)
                  //       })
                  //       item.field26 = arr2B
                  //       if(item.score == null) {
                  //         item.score = 3
                  //       }
                  //   })
                  //   this.scoreList = this.scoreList1
                  // }
                   else {
                    this.scoreList = this.scoreList1
                  }
                } else {
                  this.scoreList = this.scoreList1
                }
                // this.scoreList.forEach(item => {
                //   console.log('=============');
                //   item.quotaName = this.form.quotaName
                //   item.quotaScore = this.form.quotaScore
                //   if (!item.attachment) {
                //     console.log('**********');
                //     item.attachment = {address: undefined}
                //   }
                //   if(this.currentObject.status==0 && this.currentObject.isRejected !== '1'){
                //       this.diaDisabled = false;
                //   }else if (this.currentObject.status==0 && this.currentObject.isRejected == '1' && item.state == '1') {
                //     this.diaDisabled = false;
                //   }else{
                //       this.diaDisabled = true;
                //   }
                // })
                this.scoreLoad = false;
              })
            }
          },
          handleNodeClick(data) {
            console.log(data,'data');
            if(data.quotaName.indexOf('监测指标') !== -1) {
              this.specialDisabled = true
              console.log(data.quotaId,'data.quotaIddata.quotaId');
              console.log(this.specialDisabled,this.specialDisabled);
            }
            if (data.quotaLevel == '1') {
              this.qName = data.quotaName
            } else if (data.quotaLevel == '2') {
              this.qform = data
              this.secondQuotaId = data.quotaId
              this.townList = []
              this.$http('post',`identity/kPIVillageQuota/findDistrictByTownQuotaId`,{townQuotaId: data.quotaId, districtId: this.user.roleCode=="TOWN_REVIEWER" ? this.user.districtId : ''},false).then(data => {
                this.townList = data
              })
            }
          },
          async loadNode(node, resolve) {
            if (node.level === 0) {
              return resolve(this.indexList);
            } else if (node.level === 1)  {
              let res = await this.showList(node.data.quotaId)
              this.secondIndexList = res
              resolve(this.secondIndexList);
            } else {
              resolve([])
            }
          },
          async loadTownNode(node, resolve) {
            if (node.level === 0) {
                return resolve(this.townList);
            } else if (node.level === 1) {
              this.$http('post',`identity/kPIVillageQuota/findDistrictByTownQuotaIdAndDistrictId`,{townQuotaId: node.data.townQuotaId, districtId: node.data.districtId},false).then(res => {
                  this.villageList = res
                  resolve(this.villageList)
              })
            } else {
              resolve([])
            }
          },
          
            showIndex(year,taskType,taskId){
                this.pageLoad = true;
                let param = {quotaYear:year,quotaLevel:'1',quotaScoringDepartId:this.user.districtId,
                    onceOrMore:taskType,taskId:taskId,districtId:this.user.districtId};
                this.$http('post',`identity/kpiQuota/list`, param, false).then(data=>{
                    this.indexList = data.reverse();
                    // this.activeTab = this.indexList[0].quotaId;
                    this.tabLabel = this.indexList[0].quotaName;
                    // this.showList(this.indexList[0].quotaId);
                    this.pageLoad = false;
                }).catch(()=>{
                    this.pageLoad = false;
                })
            },
            async showList(quotaId){
                this.cardLoad = true;
                let param = {districtId:this.user.districtId, parentQuotaId: quotaId, isReviewOrMake: "1",
                    quarter: this.currentObject.taskQuarter,taskId:this.currentObject.taskId};
                this.indexDataList = [];
                this.initCun = [];
                let isDepart = this.user.roleCode.indexOf('DEPART')>-1?'1':'0';
                let res = await this.$http('post',`identity/kPITownQuota/getAll?isDepart=${isDepart}&townDistrictId=${this.currentTown}`, param, false)
                    this.indexDataList = res;
                    this.cardLoad = false;
                return res
            },
            handleTab(tab){
                this.tabLabel = this.indexList[tab.index].quotaName;
                if(this.user.roleCode!="TOWN_REVIEWER"){
                    this.currentTown = this.townList[0].districtId;
                    this.townIndex = 0;
                }
                this.showList(tab.name);
            },
            async getSum(item) {
              let res = await this.$http('get',`identity/kPIVillageQuota/degreeCheck/cjsj/${item.parentDistrictId}/${this.currentObject.taskId}/${item.villageLevelAchievements}`, false)
              if(!res.res) {
                this.$confirm('当前所选等次已超出该镇所占比例，请选择其他等次', '提示', {
                  confirmButtonText: '确定',
                  showCancelButton: false,
                  closeOnClickModal:false,
                  closeOnPressEscape: false,
                  showClose:false,
                  type: 'warning'
                }).then(() => {
                  if (item.score == '40') {
                    item.villageLevelAchievements = 'A'
                  } else if (item.score == '36') {
                    item.villageLevelAchievements = 'B'
                  } else if (item.score == '32') {
                    item.villageLevelAchievements = 'C'
                  } else if (item.score == '28') {
                    item.villageLevelAchievements = 'D'
                  } else {
                    item.villageLevelAchievements = ''
                  }
                  return false
                })
              } else {
                if (item.villageLevelAchievements == 'A') {
                  item.score = '40'
                } else if (item.villageLevelAchievements == 'B') {
                  item.score = '36'
                } else if (item.villageLevelAchievements == 'C') {
                  item.score = '32'
                } else if (item.villageLevelAchievements == 'D') {
                  item.score = '28'
                }
              }
            },
            async getRoutineSum (item) {
              console.log(item,'itemitemitemitemitem');
              let res = await this.$http('get',`identity/kPIVillageQuota/degreeCheck/rcgz/${item.parentDistrictId}/${this.currentObject.taskId}/${item.field2}`, false)
              if(!res.res) {
                this.$confirm('当前所选等次已超出该镇所占比例，请选择其他等次', '提示', {
                  confirmButtonText: '确定',
                  showCancelButton: false,
                  closeOnClickModal:false,
                  closeOnPressEscape: false,
                  showClose:false,
                  type: 'warning'
                }).then(() => {
                  if (item.score == '10') {
                    item.field2 = 'A'
                  } else if (item.score == '8') {
                    item.field2 = 'B'
                  } else if (item.score == '5') {
                    item.field2 = 'C'
                  } else {
                    item.field2 = ''
                  }
                  return false
                })
              } else {
                if (item.field2 == 'A') {
                  item.score = '10'
                } else if (item.field2 == 'B') {
                  item.score = '8'
                } else if (item.field2 == 'C') {
                  item.score = '5'
                } 
              }
            },
            getScoreSum(item){
              let score = parseFloat(item.partyActivityFinishRatio || 0) + parseFloat(item.cadrePosts || 0) +parseFloat(item.field31 || 0) +parseFloat(item.field32 || 0) +parseFloat(item.field33 || 0) +parseFloat(item.field34 || 0)
              item.score = score.toFixed(3)
            },
            getProsperScoreSum(item){
              let score = parseFloat(item.manyidu) + parseFloat(item.diaDisabled) +parseFloat(item.cadreBelowThirtyFive) +parseFloat(item.cadreBetweenThirtyFiveToFifty) +parseFloat(item.cleanFinishRatio || 0)
              item.score = score.toFixed(3)
            },
            getPetitionItemScoreSum(item){
              let petitionLetterAmount = 0
              let skipPetitionLetterAmount = 0
              let defusePetitionLetterAmount = 0
              let result = parseFloat(item.field27 || 0) / parseFloat(item.field28 || 0) * 1000
              if (result<0.9) {
                petitionLetterAmount = 2
              } else if (result<1.7) {
                petitionLetterAmount = 1.6
              } else if (result<3) {
                petitionLetterAmount = 1
              } else {
                petitionLetterAmount = 0
              }
              let result1 = parseFloat(item.field29 || 0) / parseFloat(item.field27 || 0)
              if (result1<0.25) {
                skipPetitionLetterAmount = 2
              } else if (result1<0.5) {
                skipPetitionLetterAmount = 1.6
              } else if (result1<0.75) {
                skipPetitionLetterAmount = 1
              } else {
                skipPetitionLetterAmount = 0
              }

              let result2 = parseFloat(item.field30 || 0) / parseFloat(item.field27 || 0)
              if (result2<0.7) {
                defusePetitionLetterAmount = 0
              } else if (result2<0.8) {
                defusePetitionLetterAmount = 0.5
              } else if (result2<0.9) {
                defusePetitionLetterAmount = 0.8
              } else {
                defusePetitionLetterAmount = 1
              }
              console.log(result,result1,result2,'result,result1,result2');
              if (parseFloat(item.field27) == 0) {
                console.log(item.field27,'00000000000000000000');
                skipPetitionLetterAmount = 2
                defusePetitionLetterAmount = 1
              }
              item.petitionLetterAmount = petitionLetterAmount
              item.skipPetitionLetterAmount = skipPetitionLetterAmount
              item.defusePetitionLetterAmount = defusePetitionLetterAmount
              this.getPetitionScoreSum(item)
            },
            getPetitionScoreSum(item){
              let score = parseFloat(item.petitionLetterAmount || 0) + parseFloat(item.skipPetitionLetterAmount || 0) +parseFloat(item.defusePetitionLetterAmount || 0)
              item.score = score.toFixed(3)
            },
            getGovSum(item){
              let score = (parseFloat(item.field10 || 0)*100+parseFloat(item.field11 || 0)*80 +parseFloat(item.field12 || 0)*50)/(parseFloat(item.field10 || 0) + parseFloat(item.field11 || 0) +parseFloat(item.field12 || 0) +parseFloat(item.field13 || 0))/100*3
              item.field14 = score.toFixed(3)
              this.getSynthesisScore(item)
            },
            getCadreSum(item){
              let score = (parseFloat(item.field15 || 0)*100+parseFloat(item.field16 || 0)*80 +parseFloat(item.field17 || 0)*50)/(parseFloat(item.field15 || 0) + parseFloat(item.field16 || 0) +parseFloat(item.field17 || 0) +parseFloat(item.field18 || 0))/100*2
              item.field19 = score.toFixed(3)
              this.getSynthesisScore(item)
            },
            getGratificationSum(item){
              let score = (parseFloat(item.field20 || 0)*100+parseFloat(item.field21 || 0)*80 +parseFloat(item.field22 || 0)*50)/(parseFloat(item.field20 || 0) + parseFloat(item.field21 || 0) +parseFloat(item.field22 || 0) +parseFloat(item.field23 || 0))/100*5
              item.field24 = score.toFixed(3)
              this.getSynthesisScore(item)
            },
            getAdministrativeAbilitySum(item) {
              let score
              let res =item.kpiEvaluations[0] 
              score = (parseFloat(res.good || 0)*100+parseFloat(res.preferably || 0) * 80 + parseFloat(res.commonly || 0) * 50)/(parseFloat(res.good || 0) + parseFloat(res.preferably || 0) +parseFloat(res.commonly || 0) +parseFloat(res.bad || 0))/100*4
              item.score = score.toFixed(3)
            },
            getSynthesisScore(item) {
              let score = parseFloat(item.field14 || 0) + parseFloat(item.field19 || 0) +parseFloat(item.field24 || 0)
              item.score = score.toFixed(3) || 0
            },
            geteConomicSum(item) {
              let average = (parseFloat(item.field6 || 0) + parseFloat(item.field7 || 0))/2 
              let score = 0
              console.log(item.field5 - average, 'item.field5 - average');
              if (item.field5 - average >= 0) {
                if (average == item.field5) {
                  score = 3
                } else if ( 0 < (item.field5 - average) && (item.field5 - average) < 10) {
                  score = 4
                } else if ( (item.field5 - average) < 20) {
                  score = 4.5
                } else if ( (item.field5 - average) < 30) {
                  score = 5
                } else if ( (item.field5 - average) < 40) {
                  score = 5.4
                } else if ( (item.field5 - average) < 50) {
                  score = 5.8
                } else if ( 50 <= (item.field5 - average)) {
                  score = 6
                }  
              } else {
                if ( -10 < (item.field5 - average)  && (item.field5 - average) < 0) {
                  score = 2
                } else if ( -20 < (item.field5 - average)) {
                  score = 1.5
                } else if ( -30 < (item.field5 - average)) {
                  score = 1
                } else if ( -40 < (item.field5 - average)) {
                  score = 0.6
                } else if ( -50 < (item.field5 - average)) {
                  score = 0.2
                } else if ( (item.field5 - average) <= -50) {
                  score = 0
                }
              }
              item.score = score
            },
            getVillageSum(item){
              // let scoreQue = 2 - item.field9.length*0.5 > 0 ? 2 - item.field9.length*0.5 : 0
              // let score = parseFloat(item.field8 || 0) + parseFloat(item.field9 || 0)
              let score
              let score1 = parseFloat(item.field8 || 0)
              let score2 = parseFloat(item.field9 || 0)
              if (score1 > 3) {
                this.$confirm('当前项分数最高为3分，请重新填写', '提示', {
                  confirmButtonText: '确定',
                  showCancelButton: false,
                  closeOnClickModal:false,
                  closeOnPressEscape: false,
                  showClose:false,
                  type: 'warning'
                }).then(() => {
                  item.field8 = ''
                  return false
                })
              }
              if (score2 > 2) {
                this.$confirm('当前项分数最高为2分，请重新填写', '提示', {
                  confirmButtonText: '确定',
                  showCancelButton: false,
                  closeOnClickModal:false,
                  closeOnPressEscape: false,
                  showClose:false,
                  type: 'warning'
                }).then(() => {
                  item.field9 = ''
                  return false
                })
              }
              score = score1 + score2
              item.score = score
            },
            getPracticalSum(item) {
              let score
              if (parseFloat(item.field3 || 0) / parseFloat(item.field5 || 0) >0.5) {
                score = 5
              } else {
                score = parseFloat(item.field3 || 0) / parseFloat(item.field5 || 0) / 0.5 * 5
              }
              item.score = score.toFixed(3) || 0
            },
            getBasicKnowledgeSum(item){
              let score
              score = (parseFloat(item.field35) || 0) / 100 * 3
              item.score = score.toFixed(3)
            },
            getStructuringSum(item){
              let score
              score = (parseFloat(item.field36) || 0) / 20 * 3
              item.score = score.toFixed(3)
            },
            getNaturalResourcesSum(item){
              let score
              let score1 = parseFloat(item.field25 || 0)
              let score2 = parseFloat(item.field26 || 0)
              if (score1 > 1) {
                this.$confirm('当前项分数最高为1分，请重新填写', '提示', {
                  confirmButtonText: '确定',
                  showCancelButton: false,
                  closeOnClickModal:false,
                  closeOnPressEscape: false,
                  showClose:false,
                  type: 'warning'
                }).then(() => {
                  item.field25 = ''
                  return false
                })
              }
              if (score2 > 2) {
                this.$confirm('当前项分数最高为2分，请重新填写', '提示', {
                  confirmButtonText: '确定',
                  showCancelButton: false,
                  closeOnClickModal:false,
                  closeOnPressEscape: false,
                  showClose:false,
                  type: 'warning'
                }).then(() => {
                  item.field26 = ''
                  return false
                })
              }
              score = score1 + score2
              item.score = score
            },
            // addQuestion(item) {
            //   let obj = {quesContent: ''}
            //   item.field9.push(obj)
            //   let scoreQue = 2 - item.field9.length*0.5 > 0 ? 2 - item.field9.length*0.5 : 0
            //   let score = parseFloat(item.field8 || 0) + parseFloat(scoreQue)
            //   item.score = score
            // },
            // addQuestion1(item) {
            //   let obj = {quesContent: ''}
            //   item.field25.push(obj)
            //   let scoreQue1 = 1 - item.field25.length*0.5 > 0 ? 1 - item.field25.length*0.5 : 0
            //   let scoreQue2 = 2 - item.field26.length*1 > 0 ? 2 - item.field26.length*1 : 0
            //   let score = parseFloat(scoreQue1) + parseFloat(scoreQue2)
            //   item.score = score
            // },
            // addQuestion2(item) {
            //   let obj = {quesContent: ''}
            //   item.field26.push(obj)
            //   let scoreQue1 = 1 - item.field25.length*0.5 > 0 ? 1 - item.field25.length*0.5 : 0
            //   let scoreQue2 = 2 - item.field26.length*1 > 0 ? 2 - item.field26.length*1 : 0
            //   let score = parseFloat(scoreQue1) + parseFloat(scoreQue2)
            //   item.score = score
            // },
            // deleteQuestion(arr, index, item){
            //   arr.splice(index,1)
            //   let scoreQue = 2 - item.field9.length*0.5 > 0 ? 2 - item.field9.length*0.5 : 0
            //   let score = parseFloat(item.field8 || 0) + parseFloat(scoreQue)
            //   item.score = score
            // },
            // deleteQuestion1(arr, index, item){
            //   console.log(item,'item');
            //   arr.splice(index,1)
            //   let scoreQue1 = 1 - item.field25.length*0.5 > 0 ? 1 - item.field25.length*0.5 : 0
            //   let scoreQue2 = 2 - item.field26.length*1 > 0 ? 2 - item.field26.length*1 : 0
            //   let score = parseFloat(scoreQue1) + parseFloat(scoreQue2)
            //   item.score = score
            // },
            getAddScoreSum(item){
              let moreArr = []
              let lessArr = []
              if (item.field37 < 0) {
                lessArr.push(item.field37)
              } 
              if (parseFloat(item.field37) >=  0) {
                moreArr.push(item.field37)
              }
              if (item.field38 < 0) {
                lessArr.push(item.field38)
              } 
              if (parseFloat(item.field38) >=  0) {
                moreArr.push(item.field38)
              }
              if (item.field39 < 0) {
                lessArr.push(item.field39)
              } 
              if (parseFloat(item.field39) >=  0) {
                moreArr.push(item.field39)
              }
              if (item.field40 < 0) {
                lessArr.push(item.field40)
              } 
              if (parseFloat(item.field40) >=  0) {
                console.log(item.field40,'item.field40');
                moreArr.push(item.field40)
              }
              let moreNum = 0
              let lessNum = 0
              moreArr.forEach(item => {
                moreNum = parseFloat(moreNum) + parseFloat(item || 0)
              })
              lessArr.forEach(item => {
                lessNum = parseFloat(lessNum) + parseFloat(item || 0)
              })
              moreNum > 3 ? moreNum = 3 : moreNum
              lessNum < -3 ? lessNum = -3 : lessNum
              console.log(moreArr,'moreArr');
              console.log(lessArr,'lessArr');
              console.log(moreNum,'moreNum');
              console.log(lessNum,'lessNum');
              let score = parseFloat(moreNum || 0) +  parseFloat(lessNum || 0)
              item.score = score.toFixed(3)
            },
            handClose(){
                this.diaVis = false;
                this.form = {};
            },
            saveScore(){
                this.scoreList.forEach(item => {
                  if (item.quotaName == '政治站位') {
                    item.score = 0
                  }
                })
                // this.scoreList.forEach(item => {
                //   if (item.quotaName == '乡村振兴重点任务') {
                //     let arr = item.field9
                //     let str = ''
                //     console.log(arr,'arrarr');
                //     arr.map(subItem => {
                //       str = str + subItem.quesContent + '&'
                //     })
                //     console.log(str,'strstr');
                //     item.field9 = ''
                //     item.field9 = str
                //     item.field9 = item.field9.substr(0, item.field9.length-1)
                //       console.log(item.field9,'item.field9item.field9');
                //   }
                // })
                // this.scoreList.forEach(item => {
                //   if (item.quotaName == '自然资源违法防控') {
                //     let arr = item.field25
                //     let str = ''
                //     arr.map(subItem => {
                //       str = str + subItem.quesContent + '&'
                //     })
                //     item.field25 = ''
                //     item.field25 = str
                //     item.field25 = item.field25.substr(0, item.field25.length-1)

                //     let arrA = item.field26
                //     let strA = ''
                //     arrA.map(subItem => {
                //       strA = strA + subItem.quesContent + '&'
                //     })
                //     item.field26 = ''
                //     item.field26 = strA
                //     item.field26 = item.field26.substr(0, item.field26.length-1)
                //   }
                // })
                this.saveBtnLoad = true;
                this.scoreLoad = true;
                this.$http('POST',`identity/kPIVillageQuota/scoring?taskId=${this.currentObject.taskId}&userDistrictId=${this.user.districtId}`,this.scoreList,false).then(data=>{
                    this.$message({
                        type:'success',
                        message:'保存成功'
                    });
                    // this.indexList.filter(this.modifyState)
                    this.handleNodeTownClick(this.townTreeData)
                    this.modifyState(data)
                    this.saveBtnLoad = false;
                    this.scoreLoad = false;
                }).catch(()=>{
                    this.saveBtnLoad = false;
                    this.scoreLoad = false;
                });
            },
            modifyState(data){
              this.indexList.forEach(item => {
                if (item.quotaId == data.townQuotaId) {
                  item.hasScore = data.townQuotaHasScoring
                }
              })
              this.secondIndexList.forEach(item => {
                if (item.quotaId == data.villageQuotaId) {
                  item.hasScore = data.quotaHasScoring
                }
              })
              this.townList.forEach(item => {
                if (item.districtId == data.parentDistrictId) {
                  item.flag = data.townHasScoring
                }
              })
              this.villageList.forEach(item => {
                if (item.districtId == data.districtId) {
                  item.flag = data.villageHasScoring
                }
              })
            },
            submitScore(){
                this.submitLoad = true;
                this.$http('POST',`identity/kPIVillageQuota/scoring?taskId=${this.currentObject.taskId}`,this.scoreList,false).then(data=>{
                    this.$message({
                        type:'success',
                        message:'打分成功！'
                    });
                    this.diaVis = false;
                    this.submitLoad = false;
                    this.form = {};
                    this.scoreList = [];
                    this.showList(this.activeTab);
                }).catch(()=>{
                    this.diaVis = false;
                    this.submitLoad = false;
                    this.form = {};
                });
            },
            /*执行任务*/
            getCurrentTask(data){
                this.currentObject = data;
                // if(this.currentObject.status==0){
                //     this.diaDisabled = false;
                // }else{
                //     this.diaDisabled = true;
                // }
                let type = '';
                if(this.currentObject.taskType=='日常工作考核'){
                    type = '一年多次'
                }else{
                    type = '一年一次'
                }
                this.showIndex(this.currentObject.taskYear,type,this.currentObject.taskId);
            },
            getTaskIndex(taskIndex) {
                this.taskIndex = taskIndex;
            },
            submit(){
                this.submitBtnLoading = true;
                this.$confirm('确认提交该任务么, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.$http("GET", `/identity/cadreTaskObject/progressNext?taskObjectId=${this.currentObject.id}&isSuccess=SUCCESS`, false).then(data => {
                        this.submitBtnLoading = false;
                        this.currentObject = data;
                        this.isShowTaskDetail = false;
                        this.$refs.PendingTask.getTaskList();
                        this.$message({
                            type: 'success',
                            message: "提交成功！"
                        })
                    });
                }).catch(() => {
                    this.submitBtnLoading = false;
                });
            },
            // showCurrentList(item){
            //     this.diaTownList = this.$store.state.towns;
            //     this.getScore(item.quotaId,0,this.diaTownList[0].districtId);
            // },
            /*部门指标详情，显示对应镇的分数*/
            handleTown(districtId,index){
                this.currentTown = districtId;
                this.townIndex = index;
                this.showList(this.activeTab);
            },
            handleFile(data,item){
              console.log('-------------------');
                let param = {
                    taskId: this.currentObject.taskId,
                    quotaId: this.secondQuotaId,
                    quotaLevel: '',
                    districtId: this.villageDistrictId,
                    quarter: '',
                    address: data
                };
                this.$http('POST',`identity/kPIAttachment/`,param,false).then(data=>{
                    if (data) {
                        this.currentAttachment = data;
                        this.scoreList.forEach(item => {
                          item.attachment = this.currentAttachment
                        })
                    };
                }).catch(e => {
                    this.$message({
                        type: 'danger',
                        message: '文件实时保存失败，请联系系统管理员!'
                    })
                })
            }
        },
        components:{
            MarkeIndex,
            PendingTask,
            FileUpload,
        },
        mounted(){

        },
        created() {
            this.user = JSON.parse(sessionStorage.getItem('userInfo'));
                // this.townList = JSON.parse(sessionStorage.getItem('towns'));
            // if(this.user.roleCode!="TOWN_REVIEWER"){
            //     this.currentTown = this.townList[0].districtId;
            //     this.townIndex = 0;
            // }

        }
    }
</script>

<style scoped lang="less">
    .NewIndexScore {
        font-size: 16px;
        line-height: 30px;
        font-family:FZHei-B01S;
        /* min-height: 600px; */
        .tree_box {
          // height: 100%;
          min-height: 600px;
          background-color: #63A9AB!important;
          border-radius: 5px;
        }

        .custom-tree-node {
          flex: 1;
          display: flex;
          align-items: center;
          justify-content: space-between;
          font-size: 18px;
          padding-right: 8px;
        }
        .tree_box_quota {
          .custom-tree-node {
            color: #fff;
          }
        }
        .tree_box_town  {
          width: 49%;
          min-height: 580px;
          margin-top: 5px;
          // margin-left: 20px;
        }
        .delete_icon {
          cursor: pointer;
          vertical-align: middle;
        }
    }
    .NewIndexScore .handleContent {
        min-height: 260px;
        margin: 30px 0;
    }
    .NewIndexScore .singleIndex {
        float: left;
        border: 2px solid #43C089;
        width: 227px;
        height: 260px;
        margin: 0 7px 15px 0;
        border-radius: 5px;
    }
    .NewIndexScore .secondTitle{
        width: 100%;
        background: #CFEFE1;
        line-height: 37px;
        height: 37px;
        font-weight: bolder;
        color: #4d4d4d;
        font-size: 14px;
        padding: 0 15px;
    }
    .NewIndexScore .secondTitle:hover{
        background: #43C089;
        color: white;
    }
    .NewIndexScore .thirdTitle{
        width: 100%;
        height: 37px;
        line-height: 37px;
        font-weight: bold;
        font-size: 14px;
        color: #919191;
        cursor: pointer;
        padding: 0 15px;
        background:rgba(246,255,251,1);
        border-bottom: 1px solid rgba(209,242,227,1);
    }
    .NewIndexScore .resultContent{
        overflow: auto;
        white-space:nowrap;
        line-height: 45px;
        font-size: 16px;
        text-align: center;
        font-weight: bold;
        border-left: 2px solid #43C089;
        border-radius: 5px;
        margin:  30px 0;
    }
    .index_content_scroll {
        overflow: auto;
        height: 255px;
    }
    .NewIndexScore .resultContent::-webkit-scrollbar-thumb,
    .index_content_scroll::-webkit-scrollbar-thumb {
        background-color: #5EC79E!important;
    }
    .NewIndexScore .resultContent::-webkit-scrollbar  {
      height: 12px  /*滚动条高度*/
    }
    .NewIndexScore .otherInfo {
        font-weight: bold;
    }
   /* .NewIndexScore .otherInfo{
        max-height: 500px;
        overflow-y: scroll;
    }*/
    .NewIndexScore .otherInfo .allCunScore{
        clear: both;
        /* border-bottom: 1px solid darkgray; */
        margin-top: 15px;
    }
    .townBtn{
        float: left;
        margin: 5px;
        border: #d3d4d6 1px solid;
        background: #f4f4f5;
        color: #909399;
        padding: 2px 15px;
        font-size: 14px;
        border-radius: 5px;
    }
    .townBtn:hover{
        cursor: pointer;
    }
    .NewIndexScore .otherInfo .loadDiv{
      margin-top: 30px;
        clear: both;
        // min-height: 300px;
    }
    .townBtnActive{
        float: left;
        margin: 5px;
        border: #51bf75 1px solid;
        background: #0fbb49;
        color: white;
        font-size: 14px;
        padding: 2px 15px;
        border-radius: 5px;
    }
    .townBtnActive:hover{
        cursor: pointer;
    }
    .NewIndexScore .otherInfo .indexLabel{
        display: inline-block;
        font-size: 16px;
        width: 240px;
    }
    .NewIndexScore .otherInfo .indexValue{
        display: inline-block;
        width: 190px;
        .el-select {
          width: 90px!important;
        }
    }
    .NewIndexScore .otherInfo .weightInput{
        display: inline-block;
        min-width: 100px;
        margin: 5px 10px;
    }
    .NewIndexScore .resultBorder{
        border-right:1px solid #CFEFE1;
        border-bottom:1px solid #CFEFE1
    }
    .NewIndexScore .lastResultBorder{
        border-right:1px solid #CFEFE1;
    }
    .NewIndexScore .outDiv{
        float: left;
        border-top: 2px solid #43C089;
        border-bottom: 2px solid #43C089;
        border-right: 1px solid #43C089;
        border-radius: 5px;
    }
    .NewIndexScore .twoIndex{
        width: 200px;
        display: inline-block;
    }
    .NewIndexScore .thirdIndex{
        width: 350px;
        display: inline-block;
    }
    .NewIndexScore .scoreIndex{
        width: 60px;
        display: inline-block;
        color: #FB2626;
        margin-left: -4px;
    }
    .NewIndexScore .cunDetail{
        width: 100px;
        display: inline-block;
        color: #43C089;
    }
    .NewIndexScore .otherInfo .tableContent{
        width: 581px;
        border-left: 1px solid #EBEEF5;
        border-top: 1px solid #EBEEF5;
        text-align: center;
    }
    .NewIndexScore .otherInfo .tableResult{
        flex: 1;
        border-right: 1px solid #EBEEF5;
        border-bottom: 1px solid #EBEEF5;
    }
    .NewIndexScore .otherInfo .tableBorder{
        border-right: 1px solid #EBEEF5;
        border-bottom: 1px solid #EBEEF5;
    }
    .NewIndexScore .titleLeftIcon{
        clear: both;
        margin: 10px 0;
        width: 140px;
        font-size: 18px;
        font-weight: bold;
        text-align: left;
        border-left: 2px solid #45A14F;
        padding-left: 10px;
        height: 18px;
        line-height: 18px;
        color: #393939;
    }
    .NewIndexScore .scoreDiv{
        padding: 10px 15px;
        border: 1px rgba(10, 155, 26, 1) solid;
        border-top: none;
        border-radius: 0 0 5px 5px;
        background: #FFFFFF;
        min-height: 600px;
    }
    .NewIndexScore .statusDiv{
        float: left;
        font-weight: bold;
        margin-right: 16px;
        height: 42px;
        font-size: 14px;
        padding: 1px 37px;
    }
    .NewIndexScore .statusButtonDiv{
        margin: 20px 0px;
        height: 42px;
    }
    .NewIndexScore .statusSubmit{
        height: 42px;
        float: left;
        width: 104px;
        font-size: 16px;
        background: #55BD94;
        color: #FFFFFF;
        border-radius: 5px;
    }

</style>
<style lang="less">
    .NewIndexScore .otherInfo  .el-input--mini .el-input__inner{
        width: 90px!important;
    }
    .NewIndexScore .otherInfo .wenti .el-input--mini .el-input__inner{
        width: 249px!important;
    }
    .NewIndexScore .otherInfo  .el-input{
        width: 90px!important;
    }
    .NewIndexScore .otherInfo  .icon_formula{
       cursor: pointer;
    }
    .tooltip_formula {
      width: 500px;
      font-size: 14px;
    }
    .NewIndexScore .otherInfo  .synthesis .el-input--mini .el-input__inner{
        width: 80px!important;
    }
    .NewIndexScore .otherInfo .el-dialog__body{
        font-size: 16px;
        line-height: 35px;
    }
    .NewIndexScore .el-tabs--card>.el-tabs__header{
        border-bottom: 2px solid #0A9B1A;
        background: transparent!important;
        margin-top: 5px;
    }
    .NewIndexScore .el-tabs--card>.el-tabs__header .el-tabs__item.is-active{
        border-radius: 5px 5px 0 0 ;
        line-height: 32px;
        height: 32px;
        background: #0A9B1A!important;
        color: white;
        margin: 0;
    }
    .NewIndexScore .el-tabs--card>.el-tabs__header .el-tabs__item{
        border-right: none!important;
        border-left: none!important;
        color: #0A9B1A;
        height: 32px;
        line-height: 32px;
        font-size: 14px;
        margin: 0;
    }
    .NewIndexScore .el-tabs__item:not(.is-active):hover {
        color: #0a9b1a !important;
    }
    .NewIndexScore {
      .el-icon-caret-right:before {
        font-size: 20px;
      }
      // .el-tree-node__label {
      //   font-size: 16px!important;
      //   color: #fff!important;
      // }
      .el-tree-node__content {
        height: 45px;
        border-radius: 5px 0 0 5px;
      }
      .tree_box_quota {
        .el-icon-caret-right:before {
          font-size: 20px;
          color: #fff;
        }
        .el-tree-node__content:hover {
              // color: #63A9AB!important;
          .el-icon-caret-right:before {
            font-size: 20px;
            color: #63A9AB;
          }
          .custom-tree-node {
            color: #63A9AB;
          }
        }
        .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
          .el-icon-caret-right:before {
            font-size: 20px;
            color: #63A9AB;
          }
          .custom-tree-node {
            color: #63A9AB;
          }
        }
      }
      .tree_box_town {
        background-color: #fff;
      }
    }
</style>
